<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: widget   value-change.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>widget&nbsp; <span class="subtitle">3.1.1</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_widget.html" title="widget">widget</a>
                
                 &gt; value-change.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
                        <div class="highlight"><pre><span class="cm">/**</span>
<span class="cm"> * &lt;p&gt;Event that fires when a text or input field has changed value as a result of a keystroke.</span>
<span class="cm"> * Attaches a timed-out listener on the keydown event, and keeps the value to provide support</span>
<span class="cm"> * for multi-keystroke character sets.&lt;/p&gt;</span>
<span class="cm"> * &lt;p&gt;This event fires when the value of the element changes, either as a result of</span>
<span class="cm"> * a keystroke, or an IME input event.&lt;/p&gt;</span>
<span class="cm"> * &lt;p&gt;This does not replace the DOM onchange event, but rather augments it to do onchange-like</span>
<span class="cm"> * logic as a result of key presses, even in multi-stroke character sets.&lt;/p&gt;</span>
<span class="cm"> *</span>
<span class="cm"> * &lt;p&gt;Known issue: If attaching to elements that are not yet available, then only the first </span>
<span class="cm"> * node will be guaranteed to have the event handler attached.&lt;/p&gt;</span>
<span class="cm"> *</span>
<span class="cm"> * @event valueChange</span>
<span class="cm"> * @for YUI</span>
<span class="cm"> * @param type {String} &#39;valueChange&#39;</span>
<span class="cm"> * @param fn {Function} the callback function</span>
<span class="cm"> * @param el {String|Node|etc} the element(s) to bind</span>
<span class="cm"> * @param o {Object} optional context object</span>
<span class="cm"> * @param args 0..n additional arguments that should be provided </span>
<span class="cm"> * to the listener.</span>
<span class="cm"> * @return {Event.Handle} the detach handle</span>
<span class="cm"> **/</span>

<span class="kd">function</span> <span class="nx">toNodeList</span> <span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="p">(</span>
    <span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="o">||</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">el</span><span class="p">))</span>
        <span class="o">?</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span>
    <span class="o">:</span> <span class="p">(</span><span class="nx">el</span> <span class="k">instanceof</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">Node</span><span class="p">)</span>
        <span class="o">?</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">all</span><span class="p">([</span><span class="nx">el</span><span class="p">.</span><span class="nx">_node</span><span class="p">])</span>
    <span class="o">:</span> <span class="p">(</span><span class="nx">el</span> <span class="k">instanceof</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">NodeList</span><span class="p">)</span>
        <span class="o">?</span> <span class="nx">el</span>
    <span class="o">:</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">all</span><span class="p">([</span><span class="nx">el</span><span class="p">])</span>
<span class="p">)};</span>

<span class="kd">function</span> <span class="nx">onAvail</span> <span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;available&quot;</span><span class="p">,</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        <span class="nx">h</span><span class="p">.</span><span class="nx">handle</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">on</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">Y</span><span class="p">,</span> <span class="nx">args</span><span class="p">);</span>
    <span class="p">},</span> <span class="nx">el</span><span class="p">);</span>
    <span class="k">return</span> <span class="nx">h</span><span class="p">;</span>
<span class="p">};</span>

<span class="kd">function</span> <span class="nx">attachProxy</span> <span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// args = [type, fn, el, o, ...]</span>
    <span class="c1">// node.on(type, fn, o, ...);</span>
    <span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">ceName</span><span class="p">(</span><span class="nx">node</span><span class="p">);</span>
    <span class="nx">args</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
    
    <span class="c1">// if event-custom is loaded, then this is gonna do something.</span>
    <span class="c1">// otherwise, it&#39;s basically just a no-op.</span>
    <span class="nx">node</span><span class="p">.</span><span class="nx">publish</span><span class="p">(</span><span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="p">{</span>
        <span class="nx">broadcast</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
        <span class="nx">emitFacade</span> <span class="o">:</span> <span class="kc">true</span>
    <span class="p">});</span>

    <span class="kd">var</span> <span class="nx">registry</span> <span class="o">=</span> <span class="nx">attachTriggers</span><span class="p">(</span><span class="nx">node</span><span class="p">),</span>
        <span class="nx">proxyHandle</span> <span class="o">=</span> <span class="nx">node</span><span class="p">.</span><span class="nx">on</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">args</span><span class="p">);</span>
    
    <span class="k">return</span> <span class="nx">proxyHandle</span><span class="p">;</span>
<span class="p">};</span>

<span class="kd">function</span> <span class="nx">ceName</span> <span class="p">(</span><span class="nx">node</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">stamp</span><span class="p">(</span><span class="nx">node</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="nx">eventName</span><span class="p">;</span>
<span class="p">};</span>

<span class="kd">function</span> <span class="nx">attachDomEventHandlers</span> <span class="p">(</span><span class="nx">handlers</span><span class="p">,</span> <span class="nx">node</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">handles</span> <span class="o">=</span> <span class="p">{};</span>
    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">handlers</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">handles</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">handleDom</span><span class="p">(</span><span class="nx">i</span><span class="p">,</span> <span class="nx">handlers</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="nx">node</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="nx">handles</span><span class="p">;</span>
<span class="p">};</span>

<span class="c1">// attach the dom events that will trigger the CE</span>
<span class="kd">function</span> <span class="nx">attachTriggers</span> <span class="p">(</span><span class="nx">node</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">key</span> <span class="o">=</span> <span class="nx">ceName</span><span class="p">(</span><span class="nx">node</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">reg</span> <span class="o">=</span> <span class="nx">registry</span><span class="p">[</span> <span class="nx">key</span> <span class="p">]</span> <span class="o">=</span> <span class="nx">registry</span><span class="p">[</span> <span class="nx">key</span> <span class="p">]</span> <span class="o">||</span> <span class="p">{</span>
        <span class="nx">count</span> <span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
        <span class="nx">handles</span> <span class="o">:</span> <span class="nx">attachDomEventHandlers</span><span class="p">(</span><span class="nx">domEventHandlers</span><span class="p">,</span> <span class="nx">node</span><span class="p">)</span>
    <span class="p">};</span>
    <span class="nx">reg</span><span class="p">.</span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
    <span class="k">return</span> <span class="nx">reg</span><span class="p">;</span>
<span class="p">};</span>

<span class="kd">function</span> <span class="nx">handleDom</span> <span class="p">(</span><span class="nx">event</span><span class="p">,</span> <span class="nx">handler</span><span class="p">,</span> <span class="nx">node</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">handle</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">event</span><span class="p">,</span> <span class="nx">handler</span><span class="p">,</span> <span class="nx">node</span><span class="p">);</span>
    <span class="nx">Y</span><span class="p">.</span><span class="nx">after</span><span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">bind</span><span class="p">(</span><span class="nx">afterDetach</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">node</span><span class="p">,</span> <span class="kc">true</span><span class="p">),</span> <span class="nx">handle</span><span class="p">,</span> <span class="s2">&quot;detach&quot;</span><span class="p">);</span>
    <span class="k">return</span> <span class="nx">handle</span><span class="p">;</span>
<span class="p">};</span>

<span class="c1">// call this after detaching a CE handler</span>
<span class="kd">function</span> <span class="nx">afterDetach</span> <span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">force</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">reg</span> <span class="o">=</span> <span class="nx">registry</span><span class="p">[</span> <span class="nx">ceName</span><span class="p">(</span><span class="nx">node</span><span class="p">)</span> <span class="p">];</span>
    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">reg</span><span class="p">)</span> <span class="k">return</span><span class="p">;</span>
    <span class="nx">reg</span><span class="p">.</span><span class="nx">count</span> <span class="o">--</span><span class="p">;</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">force</span><span class="p">)</span> <span class="nx">reg</span><span class="p">.</span><span class="nx">count</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">reg</span><span class="p">.</span><span class="nx">count</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">delete</span> <span class="nx">registry</span><span class="p">[</span> <span class="nx">ceName</span><span class="p">(</span><span class="nx">node</span><span class="p">)</span> <span class="p">];</span>
        <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">reg</span><span class="p">.</span><span class="nx">handles</span><span class="p">)</span> <span class="nx">reg</span><span class="p">.</span><span class="nx">handles</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">detach</span><span class="p">();</span>
    <span class="p">}</span>
<span class="p">};</span>

<span class="kd">var</span> <span class="nx">registry</span> <span class="o">=</span> <span class="p">{},</span>
    <span class="nx">event</span> <span class="o">=</span> <span class="p">{</span>
        <span class="nx">on</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">type</span><span class="p">,</span> <span class="nx">fn</span><span class="p">,</span> <span class="nx">el</span><span class="p">,</span> <span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">args</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nb">Array</span><span class="p">(</span><span class="nx">arguments</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="kc">true</span><span class="p">),</span>
                <span class="nx">nodeList</span> <span class="o">=</span> <span class="nx">toNodeList</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">nodeList</span><span class="p">.</span><span class="nx">size</span><span class="p">()</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="k">return</span> <span class="nx">onAvail</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">args</span><span class="p">);</span>
            
            <span class="nx">args</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="nx">o</span> <span class="o">=</span> <span class="nx">o</span> <span class="o">||</span> <span class="p">((</span><span class="nx">nodeList</span><span class="p">.</span><span class="nx">size</span><span class="p">()</span> <span class="o">===</span> <span class="mi">1</span><span class="p">)</span> <span class="o">?</span> <span class="nx">nodeList</span><span class="p">.</span><span class="nx">item</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">:</span> <span class="nx">nodeList</span><span class="p">);</span>
            
            <span class="kd">var</span> <span class="nx">handles</span> <span class="o">=</span> <span class="p">[];</span>
            <span class="nx">nodeList</span><span class="p">.</span><span class="nx">each</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">node</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">proxyHandle</span> <span class="o">=</span> <span class="nx">attachProxy</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">args</span><span class="p">);</span>
                <span class="nx">handles</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">proxyHandle</span><span class="p">);</span>
                <span class="c1">// hook into the detach event to remove it from that node.</span>
                <span class="nx">Y</span><span class="p">.</span><span class="nx">after</span><span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">bind</span><span class="p">(</span><span class="nx">afterDetach</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">node</span><span class="p">),</span> <span class="nx">proxyHandle</span><span class="p">,</span> <span class="s2">&quot;detach&quot;</span><span class="p">);</span>
            <span class="p">});</span>
            <span class="c1">// return a handle</span>
            <span class="k">return</span> <span class="p">{</span> <span class="nx">evt</span><span class="o">:</span><span class="nx">handles</span><span class="p">,</span> <span class="nx">sub</span><span class="o">:</span><span class="nx">nodeList</span><span class="p">,</span> <span class="nx">detach</span><span class="o">:</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
                <span class="nx">Y</span><span class="p">.</span><span class="nb">Array</span><span class="p">.</span><span class="nx">each</span><span class="p">(</span><span class="nx">handles</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">h</span><span class="p">)</span> <span class="p">{</span> <span class="nx">h</span><span class="p">.</span><span class="nx">detach</span><span class="p">()</span> <span class="p">});</span>
            <span class="p">}};</span>
        <span class="p">}</span>
    <span class="p">},</span>
    
    
    <span class="c1">// IMPLEMENTATION SPECIFIC</span>
    <span class="nx">eventName</span> <span class="o">=</span> <span class="s2">&quot;valueChange&quot;</span><span class="p">,</span>
    <span class="nx">domEventHandlers</span> <span class="o">=</span> <span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">valueHistory</span> <span class="o">=</span> <span class="p">{},</span> <span class="nx">intervals</span> <span class="o">=</span> <span class="p">{},</span> <span class="nx">timeouts</span> <span class="o">=</span> <span class="p">{};</span>
        
        <span class="kd">function</span> <span class="nx">startPolling</span> <span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">key</span> <span class="o">=</span> <span class="nx">ceName</span><span class="p">(</span><span class="nx">node</span><span class="p">);</span>
            <span class="c1">// avoid duplicates</span>
            <span class="nx">stopPolling</span><span class="p">(</span><span class="nx">node</span><span class="p">);</span>
            <span class="nx">intervals</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span> <span class="o">=</span> <span class="nx">setInterval</span><span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">bind</span><span class="p">(</span><span class="nx">poller</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">node</span><span class="p">,</span> <span class="nx">e</span><span class="p">),</span> <span class="mi">50</span><span class="p">);</span>
            <span class="nx">timeouts</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span> <span class="o">=</span> <span class="nx">setTimeout</span><span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">bind</span><span class="p">(</span><span class="nx">stopPolling</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">node</span><span class="p">),</span> <span class="mi">10000</span><span class="p">);</span>
        <span class="p">};</span>
        <span class="kd">function</span> <span class="nx">stopPolling</span> <span class="p">(</span><span class="nx">node</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">key</span> <span class="o">=</span> <span class="nx">ceName</span><span class="p">(</span><span class="nx">node</span><span class="p">);</span>
            <span class="nx">clearTimeout</span><span class="p">(</span><span class="nx">timeouts</span><span class="p">[</span><span class="nx">key</span><span class="p">]);</span>
            <span class="nx">clearInterval</span><span class="p">(</span><span class="nx">intervals</span><span class="p">[</span><span class="nx">key</span><span class="p">]);</span>
        <span class="p">};</span>
        <span class="kd">function</span> <span class="nx">poller</span> <span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">key</span> <span class="o">=</span> <span class="nx">ceName</span><span class="p">(</span><span class="nx">node</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="nx">node</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;value&quot;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="o">===</span> <span class="nx">valueHistory</span><span class="p">[</span><span class="nx">key</span><span class="p">])</span> <span class="k">return</span><span class="p">;</span>
            <span class="nx">node</span><span class="p">.</span><span class="nx">fire</span><span class="p">(</span><span class="nx">key</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">type</span> <span class="o">:</span> <span class="nx">eventName</span><span class="p">,</span>
                <span class="nx">value</span> <span class="o">:</span> <span class="nx">value</span><span class="p">,</span>
                <span class="nx">oldValue</span> <span class="o">:</span> <span class="nx">valueHistory</span><span class="p">[</span><span class="nx">key</span><span class="p">],</span>
                <span class="nx">_event</span> <span class="o">:</span> <span class="nx">e</span><span class="p">,</span>
                <span class="nx">target</span> <span class="o">:</span> <span class="nx">node</span><span class="p">,</span>
                <span class="nx">currentTarget</span> <span class="o">:</span> <span class="nx">node</span>
            <span class="p">});</span>
            
            <span class="nx">valueHistory</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span> <span class="o">=</span> <span class="nx">node</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;value&quot;</span><span class="p">);</span>
            <span class="nx">startPolling</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">e</span><span class="p">);</span>
            
        <span class="p">};</span>
        
        <span class="kd">function</span> <span class="nx">keyUpHandler</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// indications that an IME has started.</span>
            <span class="c1">// poll for 10 seconds.</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">charCode</span> <span class="o">===</span> <span class="mi">229</span> <span class="o">||</span> <span class="nx">e</span><span class="p">.</span><span class="nx">charCode</span> <span class="o">===</span> <span class="mi">197</span><span class="p">)</span> <span class="nx">startPolling</span><span class="p">(</span>
                <span class="nx">e</span><span class="p">.</span><span class="nx">currentTarget</span><span class="p">,</span> <span class="nx">e</span>
            <span class="p">);</span>
        <span class="p">};</span>
        <span class="kd">function</span> <span class="nx">blurHandler</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">stopPolling</span><span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">currentTarget</span><span class="p">);</span>
        <span class="p">};</span>
        <span class="kd">function</span> <span class="nx">keyDownHandler</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">startPolling</span><span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">currentTarget</span><span class="p">,</span> <span class="nx">e</span><span class="p">);</span>
        <span class="p">};</span>
        
        <span class="k">return</span> <span class="p">{</span>
            <span class="nx">keyup</span> <span class="o">:</span> <span class="nx">keyUpHandler</span><span class="p">,</span>
            <span class="nx">blur</span> <span class="o">:</span> <span class="nx">blurHandler</span><span class="p">,</span>
            <span class="nx">keydown</span> <span class="o">:</span> <span class="nx">keyDownHandler</span>
        <span class="p">};</span>
    <span class="p">})();</span>
    <span class="c1">// /IMPLEMENTATION SPECIFIC</span>
    


<span class="nx">Y</span><span class="p">.</span><span class="nx">Env</span><span class="p">.</span><span class="nx">evt</span><span class="p">.</span><span class="nx">plugins</span><span class="p">[</span><span class="nx">eventName</span><span class="p">]</span> <span class="o">=</span> <span class="nx">event</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">Y</span><span class="p">.</span><span class="nx">Node</span><span class="p">)</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">Node</span><span class="p">.</span><span class="nx">DOM_EVENTS</span><span class="p">[</span><span class="nx">eventName</span><span class="p">]</span> <span class="o">=</span> <span class="nx">event</span><span class="p">;</span>
</pre></div>

                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_align-plugin.html" title="align-plugin">align-plugin</a></li>
                                <li class=""><a href="module_anim.html" title="anim">anim</a></li>
                                <li class=""><a href="module_async-queue.html" title="async-queue">async-queue</a></li>
                                <li class=""><a href="module_attribute.html" title="attribute">attribute</a></li>
                                <li class=""><a href="module_base.html" title="base">base</a></li>
                                <li class=""><a href="module_cache.html" title="cache">cache</a></li>
                                <li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li>
                                <li class=""><a href="module_collection.html" title="collection">collection</a></li>
                                <li class=""><a href="module_console.html" title="console">console</a></li>
                                <li class=""><a href="module_console-filters.html" title="console-filters">console-filters</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_dataschema.html" title="dataschema">dataschema</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatype.html" title="datatype">datatype</a></li>
                                <li class=""><a href="module_dd.html" title="dd">dd</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dump.html" title="dump">dump</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-custom.html" title="event-custom">event-custom</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_intl.html" title="intl">intl</a></li>
                                <li class=""><a href="module_io.html" title="io">io</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_loader.html" title="loader">loader</a></li>
                                <li class=""><a href="module_node.html" title="node">node</a></li>
                                <li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li>
                                <li class=""><a href="module_node-menunav.html" title="node-menunav">node-menunav</a></li>
                                <li class=""><a href="module_oop.html" title="oop">oop</a></li>
                                <li class=""><a href="module_overlay.html" title="overlay">overlay</a></li>
                                <li class=""><a href="module_plugin.html" title="plugin">plugin</a></li>
                                <li class=""><a href="module_pluginhost.html" title="pluginhost">pluginhost</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_querystring.html" title="querystring">querystring</a></li>
                                <li class=""><a href="module_queue-promote.html" title="queue-promote">queue-promote</a></li>
                                <li class=""><a href="module_shim-plugin.html" title="shim-plugin">shim-plugin</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_sortable.html" title="sortable">sortable</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_substitute.html" title="substitute">substitute</a></li>
                                <li class=""><a href="module_swf.html" title="swf">swf</a></li>
                                <li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_test.html" title="test">test</a></li>
                                <li class="selected"><a href="module_widget.html" title="widget">widget</a></li>
                                <li class=""><a href="module_widget-anim.html" title="widget-anim">widget-anim</a></li>
                                <li class=""><a href="module_widget-child.html" title="widget-child">widget-child</a></li>
                                <li class=""><a href="module_widget-locale.html" title="widget-locale">widget-locale</a></li>
                                <li class=""><a href="module_widget-parent.html" title="widget-parent">widget-parent</a></li>
                                <li class=""><a href="module_widget-position.html" title="widget-position">widget-position</a></li>
                                <li class=""><a href="module_widget-position-align.html" title="widget-position-align">widget-position-align</a></li>
                                <li class=""><a href="module_widget-position-constrain.html" title="widget-position-constrain">widget-position-constrain</a></li>
                                <li class=""><a href="module_widget-stack.html" title="widget-stack">widget-stack</a></li>
                                <li class=""><a href="module_widget-stdmod.html" title="widget-stdmod">widget-stdmod</a></li>
                                <li class=""><a href="module_yui.html" title="yui">yui</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="Widget.html" title="Widget">Widget</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class="selected"><a href="value-change.js.html" title="value-change.js">value-change.js</a></li>
                                <li class=""><a href="Widget.js.html" title="Widget.js">Widget.js</a></li>
                                <li class=""><a href="WidgetHTMLParser.js.html" title="WidgetHTMLParser.js">WidgetHTMLParser.js</a></li>
                                <li class=""><a href="WidgetLocale.js.html" title="WidgetLocale.js">WidgetLocale.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2010 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">

    var ALL_YUI_PROPS = [{"access": "protected", "host": "Widget", "name": "_applyParsedConfig", "url": "Widget.html#method__applyParsedConfig", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_applyParser", "url": "Widget.html#method__applyParser", "type": "method"}, {"access": "private", "host": "Widget", "name": "_bindAttrUI", "url": "Widget.html#method__bindAttrUI", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_bindDOM", "url": "Widget.html#method__bindDOM", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_bindUI", "url": "Widget.html#method__bindUI", "type": "method"}, {"access": "protected", "host": "Widget", "name": "bindUI", "url": "Widget.html#method_bindUI", "type": "method"}, {"access": "private", "host": "Widget", "name": "_BIND_UI_ATTRS", "url": "Widget.html#property__BIND_UI_ATTRS", "type": "property"}, {"access": "", "host": "Widget", "name": "blur", "url": "Widget.html#method_blur", "type": "method"}, {"access": "", "host": "Widget", "name": "boundingBox", "url": "Widget.html#config_boundingBox", "type": "config"}, {"access": "", "host": "Widget", "name": "boundingBoxChange", "url": "Widget.html#event_boundingBoxChange", "type": "event"}, {"access": "", "host": "Widget", "name": "BOUNDING_TEMPLATE", "url": "Widget.html#property_BOUNDING_TEMPLATE", "type": "property"}, {"access": "private", "host": "Widget", "name": "_buildCfg", "url": "Widget.html#property__buildCfg", "type": "property"}, {"access": "", "host": "Widget", "name": "contentBox", "url": "Widget.html#config_contentBox", "type": "config"}, {"access": "", "host": "Widget", "name": "contentBoxChange", "url": "Widget.html#event_contentBoxChange", "type": "event"}, {"access": "", "host": "Widget", "name": "CONTENT_TEMPLATE", "url": "Widget.html#property_CONTENT_TEMPLATE", "type": "property"}, {"access": "private", "host": "Widget", "name": "_createUIEvent", "url": "Widget.html#method__createUIEvent", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_defaultCB", "url": "Widget.html#method__defaultCB", "type": "method"}, {"access": "", "host": "Widget", "name": "DEF_PARENT_NODE", "url": "Widget.html#property_DEF_PARENT_NODE", "type": "property"}, {"access": "protected", "host": "Widget", "name": "_defRenderFn", "url": "Widget.html#method__defRenderFn", "type": "method"}, {"access": "", "host": "Widget", "name": "DEF_UNIT", "url": "Widget.html#property_DEF_UNIT", "type": "property"}, {"access": "protected", "host": "Widget", "name": "destructor", "url": "Widget.html#method_destructor", "type": "method"}, {"access": "", "host": "Widget", "name": "disable", "url": "Widget.html#method_disable", "type": "method"}, {"access": "", "host": "Widget", "name": "disabled", "url": "Widget.html#config_disabled", "type": "config"}, {"access": "", "host": "Widget", "name": "disabledChange", "url": "Widget.html#event_disabledChange", "type": "event"}, {"access": "", "host": "Widget", "name": "enable", "url": "Widget.html#method_enable", "type": "method"}, {"access": "", "host": "Widget", "name": "focus", "url": "Widget.html#method_focus", "type": "method"}, {"access": "", "host": "Widget", "name": "focused", "url": "Widget.html#config_focused", "type": "config"}, {"access": "", "host": "Widget", "name": "focusedChange", "url": "Widget.html#event_focusedChange", "type": "event"}, {"access": "", "host": "Widget", "name": "getClassName", "url": "Widget.html#method_getClassName", "type": "method"}, {"access": "", "host": "Widget", "name": "getDefaultLocale", "url": "Widget.html#method_getDefaultLocale", "type": "method"}, {"access": "private", "host": "Widget", "name": "_getHtmlParser", "url": "Widget.html#method__getHtmlParser", "type": "method"}, {"access": "", "host": "Widget", "name": "getSkinName", "url": "Widget.html#method_getSkinName", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_getSrcNode", "url": "Widget.html#method__getSrcNode", "type": "method"}, {"access": "", "host": "Widget", "name": "getString", "url": "Widget.html#method_getString", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_getStrings", "url": "Widget.html#method__getStrings", "type": "method"}, {"access": "", "host": "Widget", "name": "getStrings", "url": "Widget.html#method_getStrings", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_getUIEventNode", "url": "Widget.html#method__getUIEventNode", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_guid", "url": "Widget.html#method__guid", "type": "method"}, {"access": "", "host": "Widget", "name": "height", "url": "Widget.html#config_height", "type": "config"}, {"access": "", "host": "Widget", "name": "heightChange", "url": "Widget.html#event_heightChange", "type": "event"}, {"access": "", "host": "Widget", "name": "hide", "url": "Widget.html#method_hide", "type": "method"}, {"access": "", "host": "Widget", "name": "id", "url": "Widget.html#config_id", "type": "config"}, {"access": "", "host": "Widget", "name": "idChange", "url": "Widget.html#event_idChange", "type": "event"}, {"access": "protected", "host": "Widget", "name": "initializer", "url": "Widget.html#method_initializer", "type": "method"}, {"access": "private", "host": "Widget", "name": "_initUIEvent", "url": "Widget.html#method__initUIEvent", "type": "method"}, {"access": "private", "host": "Widget", "name": "_isUIEvent", "url": "Widget.html#method__isUIEvent", "type": "method"}, {"access": "", "host": "Widget", "name": "locale", "url": "Widget.html#config_locale", "type": "config"}, {"access": "", "host": "Widget", "name": "localeChange", "url": "Widget.html#event_localeChange", "type": "event"}, {"access": "protected", "host": "Widget", "name": "_onDocFocus", "url": "Widget.html#method__onDocFocus", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_onDocMouseDown", "url": "Widget.html#method__onDocMouseDown", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_removeLoadingClassNames", "url": "Widget.html#method__removeLoadingClassNames", "type": "method"}, {"access": "", "host": "Widget", "name": "render", "url": "Widget.html#method_render", "type": "method"}, {"access": "", "host": "Widget", "name": "render", "url": "Widget.html#config_render", "type": "config"}, {"access": "private", "host": "Widget", "name": "_renderBox", "url": "Widget.html#method__renderBox", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_renderBoxClassNames", "url": "Widget.html#method__renderBoxClassNames", "type": "method"}, {"access": "", "host": "Widget", "name": "renderChange", "url": "Widget.html#event_renderChange", "type": "event"}, {"access": "", "host": "Widget", "name": "rendered", "url": "Widget.html#config_rendered", "type": "config"}, {"access": "", "host": "Widget", "name": "renderedChange", "url": "Widget.html#event_renderedChange", "type": "event"}, {"access": "protected", "host": "Widget", "name": "renderer", "url": "Widget.html#method_renderer", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_renderUI", "url": "Widget.html#method__renderUI", "type": "method"}, {"access": "protected", "host": "Widget", "name": "renderUI", "url": "Widget.html#method_renderUI", "type": "method"}, {"access": "private", "host": "Widget", "name": "_setAttrUI", "url": "Widget.html#method__setAttrUI", "type": "method"}, {"access": "private", "host": "Widget", "name": "_setBB", "url": "Widget.html#method__setBB", "type": "method"}, {"access": "private", "host": "Widget", "name": "_setBox", "url": "Widget.html#method__setBox", "type": "method"}, {"access": "private", "host": "Widget", "name": "_setCB", "url": "Widget.html#method__setCB", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_setStrings", "url": "Widget.html#method__setStrings", "type": "method"}, {"access": "", "host": "Widget", "name": "show", "url": "Widget.html#method_show", "type": "method"}, {"access": "", "host": "Widget", "name": "srcNode", "url": "Widget.html#config_srcNode", "type": "config"}, {"access": "", "host": "Widget", "name": "srcNodeChange", "url": "Widget.html#event_srcNodeChange", "type": "event"}, {"access": "", "host": "Widget", "name": "strings", "url": "Widget.html#config_strings", "type": "config"}, {"access": "", "host": "Widget", "name": "stringsChange", "url": "Widget.html#event_stringsChange", "type": "event"}, {"access": "protected", "host": "Widget", "name": "_strSetter", "url": "Widget.html#method__strSetter", "type": "method"}, {"access": "private", "host": "Widget", "name": "_syncAttrUI", "url": "Widget.html#method__syncAttrUI", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_syncUI", "url": "Widget.html#method__syncUI", "type": "method"}, {"access": "protected", "host": "Widget", "name": "syncUI", "url": "Widget.html#method_syncUI", "type": "method"}, {"access": "private", "host": "Widget", "name": "_SYNC_UI_ATTRS", "url": "Widget.html#property__SYNC_UI_ATTRS", "type": "property"}, {"access": "", "host": "Widget", "name": "tabIndex", "url": "Widget.html#config_tabIndex", "type": "config"}, {"access": "", "host": "Widget", "name": "tabIndexChange", "url": "Widget.html#event_tabIndexChange", "type": "event"}, {"access": "", "host": "Widget", "name": "toString", "url": "Widget.html#method_toString", "type": "method"}, {"access": "", "host": "Widget", "name": "UI_EVENTS", "url": "Widget.html#property_UI_EVENTS", "type": "property"}, {"access": "private", "host": "Widget", "name": "_uiSetDim", "url": "Widget.html#method__uiSetDim", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_uiSetDisabled", "url": "Widget.html#method__uiSetDisabled", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_uiSetFocused", "url": "Widget.html#method__uiSetFocused", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_uiSetHeight", "url": "Widget.html#method__uiSetHeight", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_uiSetTabIndex", "url": "Widget.html#method__uiSetTabIndex", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_uiSetVisible", "url": "Widget.html#method__uiSetVisible", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_uiSetWidth", "url": "Widget.html#method__uiSetWidth", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_uiSizeCB", "url": "Widget.html#method__uiSizeCB", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_unbindDOM", "url": "Widget.html#method__unbindDOM", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_unbindUI", "url": "Widget.html#method__unbindUI", "type": "method"}, {"access": "protected", "host": "Widget", "name": "_validTabIndex", "url": "Widget.html#method__validTabIndex", "type": "method"}, {"access": "", "host": "Widget", "name": "visible", "url": "Widget.html#config_visible", "type": "config"}, {"access": "", "host": "Widget", "name": "visibleChange", "url": "Widget.html#event_visibleChange", "type": "event"}, {"access": "", "host": "Widget", "name": "widget:contentUpdate", "url": "Widget.html#event_widget:contentUpdate", "type": "event"}, {"access": "", "host": "Widget", "name": "widget:render", "url": "Widget.html#event_widget:render", "type": "event"}, {"access": "", "host": "Widget", "name": "Widget.ATTRS", "url": "Widget.html#property_Widget.ATTRS", "type": "property"}, {"access": "private", "host": "Widget", "name": "Widget.CSS_PREFIX", "url": "Widget.html#property_Widget.CSS_PREFIX", "type": "property"}, {"access": "", "host": "Widget", "name": "Widget.getByNode", "url": "Widget.html#method_Widget.getByNode", "type": "method"}, {"access": "", "host": "Widget", "name": "Widget.HTML_PARSER", "url": "Widget.html#property_Widget.HTML_PARSER", "type": "property"}, {"access": "", "host": "Widget", "name": "Widget.NAME", "url": "Widget.html#property_Widget.NAME", "type": "property"}, {"access": "", "host": "Widget", "name": "Widget.UI_SRC", "url": "Widget.html#property_Widget.UI_SRC", "type": "property"}, {"access": "", "host": "Widget", "name": "width", "url": "Widget.html#config_width", "type": "config"}, {"access": "", "host": "Widget", "name": "widthChange", "url": "Widget.html#event_widthChange", "type": "event"}];
</script>
</body>
</html>
